package com.tp;
import org.json.JSONArray;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
import android.widget.TextView;

public class Search implements OnClickListener {
	Context activity;
	TextView obj;

	static JSONArray jArr;
	int type;

	public Search(Activity activity) {
		this.activity = activity;
		String types[] = { "Tìm đối tượng", "Tìm ngày hành trình" };
		AlertDialog.Builder b = new AlertDialog.Builder(activity);
		b.setTitle("Tìm kiếm");

		b.setItems(types, this);
		// activity = cxt;

		b.setItems(types, this);

		b.show();

	}

	/*
	 * * (non-Javadoc)
	 * 
	 * @see
	 * android.content.DialogInterface.OnClickListener#onClick(android.content
	 * .DialogInterface, int)
	 */

	@Override
	public void onClick(DialogInterface dialog, int which) {
		// TODO Auto-generated method stub
		if (which == 0)
			activity.startActivity(new Intent(activity, SearchObject.class));
		else if (which == 1)
			activity.startActivity(new Intent(activity, SearchTrip.class));
	}
}
